<?php
echo $this->Session->flash();
echo $this->Form->create('Faqs', array('action' => 'add', 'type' => 'file'));
?>
<div class="row">
	<div class="col-lg-12">
		<h2 class="page-header"><?php echo $title_for_layout?></h2>
	</div>
</div>
<div class="row">
	<table class="table table-striped table-bordered table-hover" id="dataTables-example">
		<tbody>
			<tr>
				<th width="15%">Category</th>
				<td>
					<div class="category_type">
						<select name="data[Faqs][category_id]" id="cat_parent_id" class="form-control">
							<?php
							foreach($listCategory as $cat):
							?>
								<option value="<?php echo $cat["id"]?>" >
								<?php
								for($j=0; $j < $cat["level"]; $j++) echo "---";
									echo $cat["cat_name"];
								?>
								</option>
							<?php
							endforeach;
							?>
						</select>
					</div>
				</td>
			</tr>
			<tr>
				<th>Câu hỏi<span class="require">*</span></th>
				<td>
				<?php

					echo $this->Form->textarea('question', array(
							'label' => false,
							'required' => false,
							'rows'=> 4,
							'cols'=> 70,
							'value'=> '',
					));
				?>
				</td>
			</tr>
			<tr>
				<th>Tên người hỏi<span class="require">*</span></th>
				<td>
				<?php
					echo $this->Form->input('name', array(
							'type' => 'text',
							'label' => false,
							'class' => 'form-control w400',
							'required' => false,
							'id'=>'question_name',
							'value'=>'',
					));
				?>
				</td>
			</tr>
			<tr>
				<th>Email người hỏi</th>
				<td>
				<?php
					echo $this->Form->input('email', array(
							'type' => 'text',
							'label' => false,
							'class' => 'form-control w400',
							'required' => false,
							'id'=>'question_email',
							'value'=>'',
					));
				?>
				</td>
			</tr>
			<tr>
				<th>Trả lời</th>
				<td>
					<?php
						echo $this->Form->textarea('answer', array(
							'label' => false,
							'class' => 'ckeditor',
							'required' => false,
							'rows'=> 4,
							'cols'=> 70,
							'value'=> '',
						));
					?>
				</td>
			</tr>

			<tr>
				<td colspan="2" align="center">
					<?php
					echo $this->Form->submit('Save',array(
						'class' => 'btn btn-primary btn-lg',
						'id' => 'Save',
						'title' => 'Save',
						'label' => FALSE,
						'div' => FALSE
					));
					?>
				</td>
			</tr>
		</tbody>
	</table>
</div>

<?php echo $this->Form->end()?>